package com.wzy.flowable.flow.Controller;

import com.wzy.flowable.flow.entity.Student;
import com.wzy.flowable.flow.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: wzy
 * @Date: 2022/02/06/14:57
 * @Description:
 */
@RestController
public class StudentController {
    @Autowired
    StudentService studentService;

    @RequestMapping("/insert")
    public void insert() {
        Student s1 = new Student(10, "猪八戒");
        studentService.insert(s1);
    }

    @GetMapping("/select/{id}")
    public Student insert(@PathVariable("id") Integer id) {
        return studentService.selectById(id);
    }

}
